package com.guava.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.struts.action.Action;
import org.struts.action.ActionForm;

import com.guava.bean.User;

public class UserAction extends Action{
	
	public String execute(HttpServletRequest req, ActionForm form, HttpServletResponse resp){
		User u = (User) form;
		
		if("lyf".equals(u.getUsername())){
			req.setAttribute("message", "添加成功！");
			return "success";
		}else{
			req.setAttribute("message", "添加失败！");
			return "fail";
		}
	}
}
